/*
 * State.cpp
 *
 *  Created on: 2014. 3. 21.
 *      Author: zenoniaonline
 */

#include "../User.h"

namespace ProjectZ {

User::State::State() {}
User::State::~State() {}

User::State::Command
User::State::GetCommand(unsigned short cmd)
{
	std::map<int, Command>::const_iterator citr;
	citr = clsCommandMap.find(cmd);
	if (citr == clsCommandMap.end())
		return NULL;

	return clsCommandMap[cmd];
}

std::string &
User::State::GetName()
{
	return _name;
}


bool
User::State::AddCommand(unsigned short cmd, User::State::Command pCommand)
{
	std::map<int, User::State::Command>::const_iterator citr;
	citr = clsCommandMap.find(cmd);
	if (citr != clsCommandMap.end())
	{
		DEBUGLOG("[ADDCOMMAND FAIL COMMAND : 0x%x]", cmd);
		return false;
	}

	clsCommandMap[cmd] = pCommand;
	return true;
}

} /* namespace ProjectZ */



